package com.hx.srv;

/**
 * @author minghuaChan
 * @since 2023/10/18 22:55
 */
import com.hx.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class YourComponent2 {

    private final PersonService personService;

    @Autowired
    public YourComponent2(PersonService personService) {
        this.personService = personService;
    }

    public void someComponentMethod() {
        // Example usage of the validated method with a validated 'Person' object
        Person person = new Person();
        person.setName("");
        person.setEmail("john.doe@example.com");

        personService.savePerson(person);
    }
}

